//
//  KCSingle.m
//  Jade
//
//  Created by king on 16/4/7.
//  Copyright © 2016年 KC. All rights reserved.
//

#import "KCSingle.h"
#import "KCKit.h"

@implementation KCSingle

- (NSArray *)nameArray {
    return @[@"塔青",@"烟青",@"沙枣青",@"鸭蛋青",@"菠菜绿",@"苹果绿",@"且末蓝",@"烟紫",@"藕粉",@"糖",@"墨",@"白"];
}
- (NSArray *)colorArray {
    return @[R_G_B_COLOR(84, 91, 97),R_G_B_COLOR(121, 109, 118),R_G_B_COLOR(72, 78, 58),R_G_B_COLOR(154, 180, 145),R_G_B_COLOR(21, 44, 19),R_G_B_COLOR(33, 85, 25),R_G_B_COLOR(138, 159, 151),R_G_B_COLOR(73, 67, 83),R_G_B_COLOR(233, 221, 196),R_G_B_COLOR(99, 67, 11),R_G_B_COLOR(27, 28, 29),R_G_B_COLOR(244, 248, 252)];
}

+ (KCSingle *)shareInstance{
    
    static dispatch_once_t pred;
    static KCSingle *single = nil;
    dispatch_once(&pred, ^{
        single = [[self alloc]init];
    });
    return single;
    
}

+ (NSDate *)dateToChinaDate:(NSDate *)date{
    
    NSTimeZone *timeZone = [NSTimeZone systemTimeZone];
    NSInteger seconds = [timeZone secondsFromGMTForDate:date];
    NSDate *newDate = [date dateByAddingTimeInterval:seconds];
    return newDate;
    
}

+ (NSSet *)notifationCategory{
    
    //Actions
    UIMutableUserNotificationAction *acceptAction = [[UIMutableUserNotificationAction alloc] init];
    
    acceptAction.identifier = @"ACCEPT_IDENTIFIER";
    acceptAction.title = @"Accept";
    acceptAction.activationMode = UIUserNotificationActivationModeForeground;
    acceptAction.destructive = NO;
    acceptAction.authenticationRequired = NO;
    
    //Categories
    UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init];
    
    inviteCategory.identifier = @"INVITE_CATEGORY";
    
    [inviteCategory setActions:@[acceptAction] forContext:UIUserNotificationActionContextDefault];
    
    [inviteCategory setActions:@[acceptAction] forContext:UIUserNotificationActionContextMinimal];
    
    NSSet *categories = [NSSet setWithObjects:inviteCategory, nil];
    
    return categories;
    
}

- (void)stateBarHidden:(BOOL)stateBar{
    
    if (stateBar)   [ShareApplication setStatusBarHidden:TRUE];
    else            [ShareApplication setStatusBarHidden:FALSE];

}

- (void)showAnimationForView:(UIView *)view andScale:(CGFloat)scale{
    
    [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        view.layer.transformScale = scale;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
            view.layer.transformScale = 1;
        } completion:^(BOOL finished) {
            
        }];
    }];
    
}


@end
